package com.cskaoyan.builder;

import com.cskaoyan.bean.Human;

/**
 * 两类方法：设置属性值的方法、建造方法
 * 调用顺序：先设置属性，在建造
 * 属性值是否映射设置的是同一个human的参数
 */
public class HumanBuilder2 {

    Human human = new Human();

    public HumanBuilder2 setHeadIq(Integer iq) {
        human.getHead().setIq(iq);
    	return this;
	}
    public HumanBuilder2 setHeadEq(Integer eq) {
        human.getHead().setEq(eq);
    	return this;
	}
    public HumanBuilder2 setHeadHair(String hair) {
        human.getHead().setHair(hair);
    	return this;
	}

    public HumanBuilder2 setLegFurther(String further) {
        human.getLeg().setFurther(further);
    	return this;
	}

    public HumanBuilder2 setLegLength(Integer length) {
        human.getLeg().setLength(length);
    	return this;
	}

    public HumanBuilder2 setArmMuscle(String muscle) {
        human.getArm().setMuscle(muscle);
    	return this;
	}

    public HumanBuilder2 setArmLength(Integer length) {
        human.getArm().setLength(length);
    	return this;
	}

    public Human build() {
        return human;
	}
}
